import axios from 'axios';

const BASE_PRE = "dev"
export const getScheduleItems = async (data) => {
    try {
        const response = await axios.get(`${BASE_PRE}/schedule/getItems`, {params: data});
        return response.data;
    } catch (error) {
        console.error('Error fetching schedule items:', error);
        throw error;
    }
};

export const updateScheduleItems = async (data) => {
    try {
        const response = await axios.post(`${BASE_PRE}/schedule/updateItems`, data);
        return response.data;
    } catch (error) {
        console.error('Error updating schedule items:', error);
        throw error;
    }
};

export const getAiReport = async (date, userId) => {
    try {
        const response = await axios.get(`${BASE_PRE}/schedule/getAiReport`, {
            params: {
                date: date,
                userId: userId
            }
        });
        return response.data;
    } catch (error) {
        console.error('Error fetching schedule items:', error);
        throw error;
    }
};